﻿<UserControl x:Class="ItemsServiceControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended"
              xmlns:my="http://schemas.microsoft.com/wpf/2008/toolkit"
              xmlns:lib="clr-namespace:HMSLibrary;assembly=HMSLibrary">
    <Grid>
        <Grid Name="MainGrid">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="100"/>
                <ColumnDefinition Width="300"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="28"/>
                <RowDefinition Height="28"/>
                <RowDefinition Height="28"/>
                <RowDefinition Height="28"/>
                <RowDefinition Height="28"/>
                <RowDefinition Height="28"/>
                <RowDefinition Height="28"/>
                <RowDefinition Height="50"/>
            </Grid.RowDefinitions>
            <TextBlock Text="Item Code :" Style="{StaticResource TextBlockStyle}"/>
            <extToolkit:WatermarkTextBox Grid.Column="1" Watermark="Item Code" Name="ItemCodeTextBox" Margin="2"/>
            <TextBlock Text="Item Name :" Grid.Row="1" Style="{StaticResource TextBlockStyle}"/>
            <extToolkit:WatermarkTextBox Grid.Column="1" Watermark="Item Name" Grid.Row="1" Name="ItemNameTextBox" Margin="2"/>
            <TextBlock Text="Rate :" Grid.Row="2" Style="{StaticResource TextBlockStyle}"/>
            <StackPanel Grid.Column="1" Grid.Row="2" Orientation="Horizontal">
                <extToolkit:WatermarkTextBox Watermark="Rate" Name="RateTextBox" Margin="2" Width="100" HorizontalAlignment="Left"/>
                <CheckBox Content="Is Inventory Item?" Name="IsInventoryItemCheckBox" Margin="5" HorizontalAlignment="Right"/>
            </StackPanel>
            <TextBlock Text="Unit :" Grid.Row="3" Style="{StaticResource TextBlockStyle}"/>
            <ComboBox Grid.Column="1" Grid.Row="3" Margin="2" Name="UOMComboBox" DisplayMemberPath="Name" SelectedValuePath="ID"/>
            <TextBlock Text="Category :" Grid.Row="4" Style="{StaticResource TextBlockStyle}"/>
            <ComboBox Grid.Column="1" Grid.Row="4" Margin="2" Name="CategoryComboBox" DisplayMemberPath="Name" SelectedValuePath="ID"/>
            <TextBlock Text="Sub Category :" Grid.Row="5" Style="{StaticResource TextBlockStyle}"/>
            <ComboBox Grid.Column="1" Grid.Row="5" Margin="2" Name="SubCategoryComboBox" DisplayMemberPath="Name" SelectedValuePath="ID"/>
            <TextBlock Text="ROL :" Grid.Row="6" Style="{StaticResource TextBlockStyle}"/>
            <extToolkit:WatermarkTextBox Grid.Column="1" Watermark="Re-Order Level" Grid.Row="6" Name="ROLTextBox" Margin="2"/>
            <TextBlock Text="Remark :" Grid.Row="7" Style="{StaticResource TextBlockStyle}"/>
            <extToolkit:WatermarkTextBox Grid.Column="1" Height="50" Watermark="Remarks" Grid.Row="7" Name="RemarkTextBox" Margin="2" AcceptsReturn="True" TextWrapping="WrapWithOverflow" VerticalScrollBarVisibility="Auto"/>
        </Grid>
        <StackPanel Name="FindStackPanel" Visibility="Collapsed">
            <lib:SearchBox x:Name="Ctrl" HorizontalAlignment="Right" Margin="10,5"
					Width="249" Height="22" Mode="{Binding SelectedValue.Content, ElementName=SearchMode}"
					Prompt="Search text" ToolTip="Type to search the current view">
                <lib:SearchBox.ContextMenu>
                    <ContextMenu>
                        <MenuItem Header="Option 1" IsCheckable="True"/>
                        <MenuItem Header="Option 2" IsCheckable="True"/>
                    </ContextMenu>
                </lib:SearchBox.ContextMenu>
                <lib:SearchBox.LayoutTransform>
                    <ScaleTransform ScaleX="{Binding Value, ElementName=Scaler}" 
																						ScaleY="{Binding Value, ElementName=Scaler}"/>
                </lib:SearchBox.LayoutTransform>
            </lib:SearchBox>
            <extToolkit:BusyIndicator Name="BusyIndicator1" Grid.ColumnSpan="3"/>
            <ScrollViewer Margin="5" MaxHeight="250">
                <my:DataGrid Grid.Row="2" Name="SearchDataGrid" Style="{StaticResource SerachDataGridStyle}">
                    <my:DataGrid.Columns>
                        <my:DataGridTemplateColumn Width="20">
                            <my:DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <Button Template="{StaticResource DeleteButtonTemp}" Name="DeleteButton" Click="DeleteButton_Click"/>
                                </DataTemplate>
                            </my:DataGridTemplateColumn.CellTemplate>
                        </my:DataGridTemplateColumn>
                        <my:DataGridTextColumn Header="Item Code" Binding="{Binding ItemCode}"/>
                        <my:DataGridTextColumn Header="Name" Binding="{Binding Name}"/>
                        <my:DataGridTextColumn Header="Rate" Binding="{Binding Rate}"/>
                        <my:DataGridTextColumn Header="IsInventoryItem" Binding="{Binding IsInventoryItem}"/>
                        <my:DataGridTextColumn Header="Category" Binding="{Binding CategoryName}"/>
                        <my:DataGridTextColumn Header="Sub Category" Binding="{Binding SubCategoryName}"/>
                        <my:DataGridTextColumn Header="UOM" Binding="{Binding UOMName}"/>
                        <my:DataGridTextColumn Header="Remarks" Binding="{Binding Description}"/>
                    </my:DataGrid.Columns>
                </my:DataGrid>
            </ScrollViewer>
        </StackPanel>
    </Grid>
</UserControl>
